package com.han.methodlog.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 邮件信息配置类
 */
@Component
public class MailConfig {

    @Value("${methodlogpro.mail.smtp}")
    private Smtp smtp;
    @Value("${methodlogpro.mail.username}")
    private String username;
    @Value("${methodlogpro.mail.password}")
    private String password;
    @Value("${methodlogpro.mail.from}")
    private String from;
    @Value("${methodlogpro.mail.to}")
    private List<String> to;
    @Value("${methodlogpro.mail.host}")
    private String host;


    // 嵌套 SMTP 配置类
    public static class Smtp {
        private String host;
        private int port;

        public String getHost() {
            return host;
        }

        public void setHost(String host) {
            this.host = host;
        }

        public int getPort() {
            return port;
        }

        public void setPort(int port) {
            this.port = port;
        }
    }

    // Getters and Setters
    public Smtp getSmtp() {
        return smtp;
    }

    public void setSmtp(Smtp smtp) {
        this.smtp = smtp;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    public List<String> getTo() {
        return to;
    }

    public void setTo(List<String> to) {
        this.to = to;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }
}
